Data transmission method, apparatus, and device in Wi-Fi network

ABSTRACT

Embodiments of this application disclose a data transmission method, an apparatus, and a device in a Wi-Fi network, to improve reliability of providing differentiated data transmission services by a network access device. The method includes: receiving an uplink packet; recording a real-time transmission indication and uplink 5-tuple information that are carried in the uplink packet; then receiving a downlink packet, where the downlink packet carries downlink 5-tuple information; and then, if a service type of the downlink packet is a preset service type, and the downlink 5-tuple information matches the uplink 5-tuple information, preferably forwarding the downlink packet based on the real-time transmission indication.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a national stage of International Application No.PCT/CN2019/112391, filed on Oct. 22, 2019, which claims priority toChinese Patent Application No. 201910547973.X, filed on Jun. 24, 2019,and Chinese Patent Application No. 201811232110.5, filed on Oct. 22,2018. All of the aforementioned patent applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the field of communications technologies,and in particular, to a data transmission method, an apparatus, and adevice in a wireless fidelity (wireless fidelity, WiFi) network.

BACKGROUND

In an existing wireless fidelity (wireless fidelity, WiFi) system,different terminals, for example, stations (station, STA), under a sameaccess point (access point, AP, also referred to as a home router or ahome gateway) usually preempt network resources through contention, tocomplete data transmission of various services, such as voice, videos,web browsing, downloading, and games. Therefore, in a case of arelatively poor communication environment, for example, in a case ofrelatively strong interference, a relatively weak signal, insufficientresources, or relatively heavy load, data transmission of some terminalsmay have adverse impact on data transmission of the other terminals. Forexample, a video playback service of a terminal A occupies a relativelyhigh bandwidth, and may occupy an available bandwidth of a game serviceof a terminal B. Consequently, a downlink transmission delay of the gameservice of the terminal B is increased, causing game freezing.

Therefore, an existing wireless quality of service (quality of service,QoS) protocol, for example, a Wi-Fi multimedia (WiFi multimedia, WMM)protocol, defines priority queues of four access categories (accesscategory, AC) in descending order of priorities: a voice (voice, VO)flow, a video (video, VI) flow, a best-effort (best-effort, BE) flow,and a background (back-ground, BK) flow. Therefore, the AP maypreferably forward data of a service with a high-priority accesscategory, to separately provide differentiated data transmissionservices for different service types.

However, in an actual data transmission process, especially in adownlink data transmission process, the foregoing priorities usuallycannot be effectively executed. For example, a specified priority isignored (for example, not supported, not parsed, or not executed), aspecified priority is tampered with (for example, randomly reduced orincreased), or priority setting permission is randomly used (forexample, all types of services are set to a highest priority).Consequently, reliability of providing differentiated data transmissionservices in an existing Wi-Fi network is relatively poor.

SUMMARY

Embodiments of this application provide a data transmission method, anapparatus, and a device in a Wi-Fi network, to identify and preferablyforward a downlink packet of a preset service type. This can resolve aproblem that although a high forwarding priority is set in a downlinkpacket, preferable forwarding is actually not implemented, so thatreliability of providing differentiated data transmission services by anetwork access device is improved.

To achieve the foregoing objective, embodiments of this applicationprovide the following technical solutions.

According to a first aspect, a data transmission method in a Wi-Finetwork is provided. The method is applied to a network access device(for example, a router). The method includes: receiving an uplinkpacket; recording a real-time transmission indication and uplink 5-tupleinformation that are carried in the uplink packet; then, receiving adownlink packet, where the downlink packet carries downlink 5-tupleinformation; and then, if a service type of the downlink packet is apreset service type, and the downlink 5-tuple information matches theuplink 5-tuple information, preferably forwarding the downlink packetbased on the real-time transmission indication.

According to the data transmission method in the Wi-Fi network providedin this application, the network access device records the real-timetransmission indication and the uplink 5-tuple information that arecarried in the uplink packet. When the service type of the downlinkpacket is the preset service type, the network access device maypreferably forward, based on the real-time transmission indication ofthe uplink packet, the downlink packet whose downlink 5-tupleinformation matches the uplink 5-tuple information. When a highforwarding priority that is set by an external network device such as aserver for the downlink packet of the preset service type is ignored,tampered with, or randomly used, the downlink packet that matches theuplink 5-tuple can still be preferably forwarded based on the real-timetransmission indication of the uplink packet. Therefore, an objective ofpreferably forwarding the downlink packet of the preset service type isachieved, and reliability of providing a differentiated datatransmission services by the network access device can be improved.

For example, the real-time transmission indication may include one ormore of the following: a differentiated services code point DSCP valuecorresponding to a highest forwarding priority, a user priority UP valuecorresponding to the highest forwarding priority, and an access categoryAC corresponding to the highest forwarding priority.

For example, the downlink 5-tuple information may include a downlinksource internet protocol IP address, a downlink destination IP address,a downlink source port, a downlink destination port, and a downlinktransmission protocol type. Correspondingly, that the service type ofthe downlink packet is the preset service type may include: The downlinkpacket meets at least one of the following conditions: The downlinksource IP address is a source IP address that provides a real-timetransmission service. The downlink source port is a source port thatprovides a real-time transmission service. The downlink transmissionprotocol type is a transmission protocol type used for the real-timetransmission service. A bandwidth occupied by the downlink packet isless than a downlink bandwidth threshold. A packet length of thedownlink packet is less than a downlink packet length threshold. Adeviation between arrival times of any two adjacent downlink packets isless than a downlink time deviation threshold.

For example, the uplink 5-tuple information may include an uplink sourceinternet protocol IP address, an uplink destination IP address, anuplink source port, an uplink destination port, and an uplinktransmission protocol type. Correspondingly, that the downlink 5-tupleinformation matches the uplink 5-tuple information may include: Thedownlink source IP address is the same as the uplink destination IPaddress. The downlink destination IP address is the same as the uplinksource IP address. The downlink source port is the same as the uplinkdestination port. The downlink destination port is the same as theuplink source port. The downlink transmission protocol type is the sameas the uplink transmission protocol type.

In a possible design method, before the preferably forwarding thedownlink packet based on the real-time transmission indication isperformed, the data transmission method in the Wi-Fi network accordingto the first aspect may further include one or more of the following:determining that a downlink data volume is greater than a downlink datavolume threshold; and determining that the downlink bandwidth is greaterthan the downlink bandwidth threshold.

In a possible design method, the data transmission method in the Wi-Finetwork may further include: not preferably forwarding a downlink packetthat corresponds to the uplink 5-tuple information and/or the downlink5-tuple information and that does not appear within a specified timeperiod.

In another possible design method, the data transmission method in theWi-Fi network may further include: limiting a downlink packet bandwidthof a first specified station STA.

Optionally, the limiting a downlink packet bandwidth of a firstspecified station STA may include at least one of the following:limiting an amount of uplink 5-tuple information and/or downlink 5-tupleinformation corresponding to a downlink packet preferably forwarded tothe first specified station STA; limiting a quantity of downlink packetspreferably forwarded to the first specified station STA; or limiting acontinuous transmission time occupied by a downlink packet preferablyforwarded to the first specified station STA.

Optionally, the limiting a downlink packet bandwidth of a firstspecified station STA may include: limiting the downlink packetbandwidth of the first specified station STA when preferably forwardinga downlink packet to a second specified station STA.

According to a second aspect, another data transmission method in aWi-Fi network is provided. The method is applied to a network accessdevice. The method includes: receiving an uplink packet, where theuplink packet carries a real-time transmission indication and uplink5-tuple information; then, receiving a downlink packet; and if a servicetype of the uplink packet is a preset service type, and downlink 5-tupleinformation matches the uplink 5-tuple information, preferablyforwarding the downlink packet based on the real-time transmissionindication, where the downlink packet carries the downlink 5-tupleinformation.

According to the data transmission method in the Wi-Fi network providedin this application, the network access device receives and records thereal-time transmission indication and the uplink 5-tuple informationthat are carried in the uplink packet. If the service type of the uplinkpacket is the preset service type, the network access device maypreferably forward, based on the real-time transmission indication ofthe uplink packet, the downlink packet whose downlink 5-tupleinformation matches the uplink 5-tuple information. When a high prioritythat is set by an external network device such as a server for thedownlink packet is ignored, tampered with, or randomly used, thedownlink packet that matches the uplink 5-tuple can still be preferablyforwarded based on the real-time transmission indication of the uplinkpacket. Therefore, an objective of preferably forwarding the downlinkpacket of the preset service type is achieved, and reliability ofproviding a differentiated data transmission services by the networkaccess device can be improved.

For example, the real-time transmission indication may include one ormore of the following: a differentiated services code point DSCP valuecorresponding to a highest forwarding priority, a user priority UP valuecorresponding to the highest forwarding priority, and an access categoryAC corresponding to the highest forwarding priority.

For example, the uplink 5-tuple information may include: an uplinksource internet protocol IP address, an uplink destination IP address,an uplink source port, an uplink destination port, and an uplinktransmission protocol type. Correspondingly, that the service type ofthe uplink packet is the preset service type may include: The servicetype of the uplink packet is the preset service type if the uplinkpacket meets at least one of the following conditions: The uplinkdestination IP address is a destination IP address that provides areal-time transmission service. The uplink destination port is adestination port that provides the real-time transmission service. Theuplink transmission protocol type is a transmission protocol type usedfor the real-time transmission service. A bandwidth occupied by theuplink packet is less than an uplink bandwidth threshold. A packetlength of the uplink packet is less than an uplink packet lengththreshold.

For example, the downlink 5-tuple information may include a downlinksource internet protocol IP address, a downlink destination IP address,a downlink source port, a downlink destination port, and a downlinktransmission protocol type. Correspondingly, that the downlink 5-tupleinformation matches the uplink 5-tuple information may include: Thedownlink source IP address is the same as the uplink destination IPaddress. The downlink destination IP address is the same as the uplinksource IP address. The downlink source port is the same as the uplinkdestination port. The downlink destination port is the same as theuplink source port. The downlink transmission protocol type is the sameas the uplink transmission protocol type.

In a possible design method, before the preferably forwarding thedownlink packet based on the real-time transmission indication isperformed, the data transmission method in the Wi-Fi network accordingto the second aspect may further include one or more of the following:determining that a downlink data volume is greater than a downlink datavolume threshold; and determining that a downlink bandwidth is greaterthan a downlink bandwidth threshold.

In a possible design method, the data transmission method in the Wi-Finetwork according to the second aspect may further include: notpreferably forwarding a downlink packet that corresponds to the uplink5-tuple information and/or the downlink 5-tuple information and thatdoes not appear within a specified time period.

In another possible design method, the data transmission method in theWi-Fi network according to the second aspect may further include:limiting a downlink packet bandwidth of a first specified station STA.

Optionally, the limiting a downlink packet bandwidth of a firstspecified station STA may include at least one of the following:limiting an amount of uplink 5-tuple information and/or downlink 5-tupleinformation corresponding to a downlink packet preferably forwarded tothe first specified station STA; limiting a quantity of downlink packetspreferably forwarded to the first specified station STA; limiting acontinuous transmission time occupied by a downlink packet preferablyforwarded to the first specified station STA; or limiting the downlinkpacket bandwidth of the first specified station STA when preferablyforwarding a downlink packet to a second specified station STA.

It should be noted that the data transmission method in the Wi-Finetwork provided in the first aspect and the data transmission method inthe Wi-Fi network provided in the second aspect may be separately used,or may be used in combination. For example, the downlink packet may bepreferably forwarded based on the real-time transmission indication ofthe uplink packet only when both the service type of the uplink packetand the service type of the downlink packet are the preset service typeand the uplink 5-tuple matches the downlink 5-tuple, so as to furtherimprove accuracy and efficiency of identifying and forwarding ahigh-priority downlink packet.

According to a third aspect, still another data transmission method in aWi-Fi network is provided. The method is applied to a network accessdevice. The method includes: receiving a downlink packet, where thedownlink packet carries downlink 5-tuple information, and the downlink5-tuple information includes a downlink source internet protocol IPaddress, a downlink destination IP address, a downlink source port, adownlink destination port, and a downlink transmission protocol type.Then, preferably forwarding the downlink packet if it is determined thata service type of the downlink packet is a preset service type. That aservice type of the downlink packet is a preset service type mayinclude: The service type of the downlink packet is the preset servicetype if the downlink packet meets at least one of the followingconditions: The downlink source IP address is a source IP address thatprovides a real-time transmission service. The downlink source port is asource port that provides the real-time transmission service. Thedownlink transmission protocol type is a transmission protocol type usedfor the real-time transmission service. A bandwidth occupied by thedownlink packet is less than a downlink bandwidth threshold. A packetlength of the downlink packet is less than a downlink packet lengththreshold. A deviation between arrival times of any two adjacentdownlink packets is less than a downlink time deviation threshold.

According to the data transmission method in the Wi-Fi network providedin this application, the network access device can identify andpreferably forward the downlink packet of the preset service type. Thiscan resolve a problem that when a high priority that is set by anexternal network device such as a server for a downlink packet isignored, tampered with, or randomly used, the network access devicecannot preferably forward the downlink packet of the preset servicetype, so that reliability of providing differentiated data transmissionservices by the network access device is improved.

According to a fourth aspect, a communications apparatus in a Wi-Finetwork is provided. The communications apparatus includes a processingmodule, a first transceiver module, and a second transceiver module. Thefirst transceiver module is configured to receive an uplink packet,where the uplink packet carries a real-time transmission indication anduplink 5-tuple information. The second transceiver module is configuredto receive a downlink packet, where the downlink packet carries downlink5-tuple information. The processing module is configured to: if aservice type of the downlink packet is a preset service type, and thedownlink 5-tuple information matches the uplink 5-tuple information,control the first transceiver module to preferably forward the downlinkpacket based on the real-time transmission indication.

For example, the real-time transmission indication may include one ormore of the following: a differentiated services code point DSCP valuecorresponding to a highest forwarding priority, a user priority UP valuecorresponding to the highest forwarding priority, and an access categoryAC corresponding to the highest forwarding priority.

For example, the downlink 5-tuple information includes a downlink sourceinternet protocol IP address, a downlink destination IP address, adownlink source port, a downlink destination port, and a downlinktransmission protocol type. Correspondingly, that a service type of thedownlink packet is a preset service type includes: The downlink packetmeets at least one of the following conditions: The downlink source IPaddress is a source IP address that provides a real-time transmissionservice. The downlink source port is a source port that provides thereal-time transmission service. The downlink transmission protocol typeis a transmission protocol type used for the real-time transmissionservice. A bandwidth occupied by the downlink packet is less than adownlink bandwidth threshold. A packet length of the downlink packet isless than a downlink packet length threshold. A deviation betweenarrival times of any two adjacent downlink packets is less than adownlink time deviation threshold.

For example, the uplink 5-tuple information includes an uplink sourceinternet protocol IP address, an uplink destination IP address, anuplink source port, an uplink destination port, and an uplinktransmission protocol type. Correspondingly, that the downlink 5-tupleinformation matches the uplink 5-tuple information includes: Thedownlink source IP address is the same as the uplink destination IPaddress. The downlink destination IP address is the same as the uplinksource IP address. The downlink source port is the same as the uplinkdestination port. The downlink destination port is the same as theuplink source port. The downlink transmission protocol type is the sameas the uplink transmission protocol type.

In a possible design method, the processing module is further configuredto: before that the processing module controls the first transceivermodule to preferably forward the downlink packet based on the real-timetransmission indication, determine that a downlink data volume isgreater than a downlink data volume threshold, or determine that thedownlink bandwidth is greater than the downlink bandwidth threshold.

In a possible design method, the processing module is further configuredto determine not to preferably forward a downlink packet thatcorresponds to the uplink 5-tuple information and/or the downlink5-tuple information and that does not appear within a specified timeperiod.

In another possible design method, the processing module is furtherconfigured to limit a downlink packet bandwidth of a first specifiedstation STA.

For example, the limiting a downlink packet bandwidth of a firstspecified station STA may include one or more of the following: limitingan amount of uplink 5-tuple information and/or downlink 5-tupleinformation corresponding to a downlink packet preferably forwarded tothe first specified station STA; limiting a quantity of downlink packetspreferably forwarded to the first specified station STA; limiting acontinuous transmission time occupied by a downlink packet preferablyforwarded to the first specified station STA; or limiting the downlinkpacket bandwidth of the first specified station STA when preferablyforwarding a downlink packet to a second specified station STA.

According to a fifth aspect, another communications apparatus in a Wi-Finetwork is provided. The communications apparatus includes a processingmodule, a first transceiver module, and a second transceiver module. Thefirst transceiver module is configured to receive an uplink packet,where the uplink packet carries a real-time transmission indication anduplink 5-tuple information. The second transceiver module is configuredto receive a downlink packet, where the downlink packet carries downlink5-tuple information. The processing module is configured to: if aservice type of the uplink packet is a preset service type, and thedownlink 5-tuple information matches the uplink 5-tuple information,control the first transceiver module to preferably forward the downlinkpacket based on the real-time transmission indication.

For example, the real-time transmission indication may include one ormore of the following: a differentiated services code point DSCP valuecorresponding to a highest forwarding priority, a user priority UP valuecorresponding to the highest forwarding priority, and an access categoryAC corresponding to the highest forwarding priority.

For example, an uplink source internet protocol IP address, an uplinkdestination IP address, an uplink source port, an uplink destinationport, and an uplink transmission protocol type. Correspondingly, that aservice type of the uplink packet is a preset service type may include:

The service type of the uplink packet is the preset service type if theuplink packet meets at least one of the following conditions: The uplinkdestination IP address is a destination IP address that provides areal-time transmission service. The uplink destination port is adestination port that provides the real-time transmission service. Theuplink transmission protocol type is a transmission protocol type usedfor the real-time transmission service. A bandwidth occupied by theuplink packet is less than an uplink bandwidth threshold. A packetlength of the uplink packet is less than an uplink packet lengththreshold.

For example, the downlink 5-tuple information includes a downlink sourceinternet protocol IP address, a downlink destination IP address, adownlink source port, a downlink destination port, and a downlinktransmission protocol type. Correspondingly, that the downlink 5-tupleinformation matches the uplink 5-tuple information includes: Thedownlink source IP address is the same as the uplink destination IPaddress. The downlink destination IP address is the same as the uplinksource IP address. The downlink source port is the same as the uplinkdestination port. The downlink destination port is the same as theuplink source port. The downlink transmission protocol type is the sameas the uplink transmission protocol type.

In a possible design method, the processing module is further configuredto: before controlling the first transceiver module to preferablyforward the downlink packet based on the real-time transmissionindication, determine that a downlink data volume is greater than adownlink data volume threshold, or determine that a downlink bandwidthis greater than a downlink bandwidth threshold.

In a possible design method, the processing module is further configuredto determine not to preferably forward a downlink packet thatcorresponds to the uplink 5-tuple information and/or the downlink5-tuple information and that does not appear within a specified timeperiod.

In another possible design method, the processing module is furtherconfigured to limit a downlink packet bandwidth of a first specifiedstation STA.

For example, the limiting a downlink packet bandwidth of a firstspecified station STA may include at least one of the following:limiting an amount of uplink 5-tuple information and/or downlink 5-tupleinformation corresponding to a downlink packet preferably forwarded tothe first specified station STA; limiting a quantity of downlink packetspreferably forwarded to the first specified station STA; or limiting acontinuous transmission time occupied by a downlink packet preferablyforwarded to the first specified station STA.

Optionally, the processing module is further configured to limit thedownlink packet bandwidth of the first specified station STA whencontrolling a transceiver module to preferably forward a downlink packetof a second specified station STA.

According to a sixth aspect, still another communications apparatus in aWi-Fi network is provided. The communications apparatus includes aprocessing module, a first transceiver module, and a second transceivermodule. The second transceiver module is configured to receive adownlink packet. The processing module is configured to: if a servicetype of the downlink packet is a preset service type, control the firsttransceiver module to preferably forward the downlink packet.

For example, the downlink packet carries a downlink source internetprotocol IP address, a downlink destination IP address, a downlinksource port, a downlink destination port, and a downlink transmissionprotocol type. Correspondingly, the processing module is furtherconfigured to: if the downlink packet meets at least one of thefollowing conditions, determine that the service type of the downlinkpacket is the preset service type: The downlink source IP address is asource IP address that provides a real-time transmission service. Thedownlink source port is a source port that provides the real-timetransmission service. The downlink transmission protocol type is atransmission protocol type used for the real-time transmission service.A bandwidth occupied by the downlink packet is less than a downlinkbandwidth threshold. A packet length of the downlink packet is less thana downlink packet length threshold. A deviation between arrival times ofany two adjacent downlink packets is less than a downlink time deviationthreshold.

According to a seventh aspect, a communications apparatus is provided.The communications apparatus includes: a processing module (which may bea processing system), a first transceiver module (which may be one ormore interfaces for interacting with a device (for example, a mobileterminal in a home network) in an internal network), and a secondtransceiver module (which may be one or more interfaces for interactingwith a device (for example, a network side device) in an externalnetwork). The processing module is configured to perform the datatransmission method in the Wi-Fi network according to any one of thepossible implementations of the first aspect to the third aspect.

Optionally, the communications apparatus according to the seventh aspectfurther includes a storage module. The storage module is configured tostore an instruction. A processing module is configured to execute theinstruction stored in the storage module, so that the communicationsapparatus performs the data transmission method in the Wi-Fi networkaccording to any one of the possible implementations of the first aspectto the third aspect.

For example, the communications apparatus according to the seventhaspect may be a chip or a chip system.

It should be noted that the communications apparatus according to theseventh aspect may be the communications apparatus according to thefourth aspect, the fifth aspect, or the sixth aspect (for example, arouter), or may be a chip or a chip system disposed in thecommunications apparatus. This is not limited in this application.

According to an eighth aspect, a network access device (for example, arouter) is provided. The network access device includes a processor anda memory. The memory is configured to store an instruction. Theprocessor is configured to execute the instruction stored in the memory,so that the network access device performs the data transmission methodin the Wi-Fi network according to any one of the possibleimplementations of the first aspect to the third aspect.

According to a ninth aspect, another network access device (for example,a router) is provided. The network access device includes a processor, amemory, a first transceiver, and a second transceiver. The firsttransceiver is configured to receive an uplink packet. The secondtransceiver is configured to receive a downlink packet. The firsttransceiver is further configured to forward the downlink packet. Thememory is configured to store an instruction. The processor isconfigured to execute the instruction in the memory, so that the networkaccess device performs the data transmission method in the Wi-Fi networkaccording to any one of the possible implementations of the first aspectto the third aspect.

According to a tenth aspect, a communications system is provided. Thecommunications system includes one or more terminals and the foregoingnetwork access device.

According to an eleventh aspect, a computer program product is provided.The computer program product includes a computer program. When thecomputer program is executed on a computer, the computer is enabled toperform the data transmission method in the Wi-Fi network according toany one of the possible implementations of the first aspect to the thirdaspect.

According to a twelfth aspect, a computer-readable storage medium isprovided. The computer-readable storage medium stores a computerprogram. When the computer program is executed on a computer, thecomputer is enabled to perform the data transmission method in the Wi-Finetwork according to any one of the possible implementations of thefirst aspect to the third aspect.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic structural diagram of a communications systemaccording to an embodiment of this application;

FIG. 2 is a schematic flowchart of a data transmission method in a Wi-Finetwork according to an embodiment of this application;

FIG. 3 is another schematic flowchart of a data transmission method in aWi-Fi network according to an embodiment of this application;

FIG. 4 is still another schematic flowchart of a data transmissionmethod in a Wi-Fi network according to an embodiment of thisapplication;

FIG. 5 is a schematic structural diagram of a communications apparatusaccording to an embodiment of this application; and

FIG. 6 is a schematic structural diagram of a network access deviceaccording to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The following describes technical solutions in this application withreference to accompanying drawings.

The technical solutions in the embodiments of this application may beapplied to various communications systems, for example, anext-generation Wi-Fi system, a 5th generation (5th generation, 5G)mobile communications system, and a future communications system such asa 6th generation (6th generation, 6G) system.

All aspects, embodiments, or features are presented in this applicationby describing a system that may include a plurality of devices,components, modules, and the like. It should be appreciated andunderstood that, each system may include another device, component,module, and the like, and/or may not include all devices, components,modules, and the like discussed with reference to the accompanyingdrawings. In addition, a combination of these solutions may be used.

In addition, in the embodiments of this application, terms such as “forexample” and “such as” are used to represent giving an example, anillustration, or a description. Any embodiment or design schemedescribed as an “example” in this application should not be explained asbeing more preferred or having more advantages than another embodimentor design scheme. Exactly, “for example” is used to present a concept ina specific manner.

In the embodiments of this application, terms “information(information)”, “signal (signal)”, “message (message)”, “channel(channel)”, and “signaling (singalling)” may be interchangeably usedsometimes. It should be noted that meanings expressed by the terms areconsistent when differences between the terms are not emphasized. Terms“of (of)”, “corresponding, relevant (corresponding, relevant)”, and“corresponding (corresponding)” may be interchangeably used sometimes.It should be noted that meanings expressed by the terms are consistentwhen differences between the terms are not emphasized.

In the embodiments of this application, sometimes a subscript such as W₁may be written in an incorrect form such as W1. Meanings expressed bythe two are consistent when differences between the two are notemphasized.

A network architecture and a service scenario described in theembodiments of this application are intended to describe the technicalsolutions in the embodiments of this application more clearly, and donot constitute a limitation on the technical solutions provided in theembodiments of this application. A person of ordinary skill in the artmay know that: With evolution of the network architecture and emergenceof new service scenarios, the technical solutions provided in theembodiments of this application are also applicable to similar technicalproblems.

In the embodiments of this application, some scenarios are described byusing a scenario in a Wi-Fi system as an example. It should be notedthat the solutions in the embodiments of this application may also beapplied to another mobile communications system, and a correspondingname may also be replaced with a name of a corresponding function in theanother mobile communications system.

The term “transceiver” or “transceiver module” in this application maybe specifically a communications interface that can receive and send asignal or data.

For ease of understanding of the embodiments of this application, acommunications system shown in FIG. 1 is first used as an example todescribe in detail a communications system applicable to the embodimentsof this application.

As shown in FIG. 1 , the communications system includes one or moreterminals, a network access device and a server. The terminal may accessan external network through the network access device, for example, theserver in the external network shown in FIG. 1 , to receive a serviceprovided by the external network, such as voice, video playback, webbrowsing, downloading, or games. The network access device usuallyincludes a transceiver module, for example, a Wi-Fi module, and mayprovide a data forwarding service for the terminal, for example,forward, to the external network, an uplink packet for which theterminal is used as a source device, and/or forward, to the terminal, adownlink packet for which the terminal is used as a destination device.In addition, the network access device may further include a schedulingmodule. The scheduling module is configured to determine an uplinkpacket and/or a downlink packet, to determine whether to acceleratetransmission of a downlink packet, and a downlink packet whosetransmission is to be accelerated. That is, the scheduling module mayprovide differentiated data transmission services for different types ofdownlink packets.

The network access device is a device that is located on a network sideof the communications system and that has a wireless transceiverfunction, or a chip that can be disposed in the device. The networkaccess device includes but is not limited to: an access point (accesspoint, AP), an evolved NodeB (evolved Node B, eNB), a radio networkcontroller (radio network controller, RNC), a NodeB (Node B, NB), a basestation controller (base station controller, BSC), a base transceiverstation (base transceiver station, BTS), a home eNodeB (for example,home evolved NodeB, or home Node B, HNB), a baseband unit (basebandunit, BBU), a wireless relay node, a wireless backhaul node, atransmission point (transmission and reception point, TRP ortransmission point, TP), or the like in a Wi-Fi system, or may be a gNBor a transmission point (TRP or TP) in a 5G system such as a new radio(new radio, NR) system, or one or a group of antenna panels (including aplurality of antenna panels) of a base station in a 5G system, or may bea network node that forms a gNB or a transmission point, for example, abaseband unit (BBU), or a distributed unit (distributed unit, DU).

In some deployments, the gNB may include a centralized unit (centralizedunit, CU) and the DU. The gNB may further include a radio unit (radiounit, RU). The CU implements some functions of the gNB, and the DUimplements some functions of the gNB. For example, the CU implementsfunctions of a radio resource control (radio resource control, RRC)layer and a packet data convergence protocol (packet data convergenceprotocol, PDCP) layer, and the DU implements functions of a radio linkcontrol (radio link control, RLC) layer, a media access control (mediaaccess control, MAC) layer, and a physical (physical, PHY) layer.Information at the RRC layer finally becomes information at the PHYlayer, or is converted from information at the PHY layer. Therefore, inthis architecture, higher layer signaling, for example, RRC layersignaling or PHCP layer signaling, may also be considered as being sentby the DU or by the DU and the RU. It may be understood that the networkdevice may be a CU node, a DU node, or a device including a CU node anda DU node. In addition, the CU may be classified as a network device inan access network RAN, or the CU may be classified as a network devicein a core network CN. This is not limited herein.

The terminal is a terminal device that accesses the communicationssystem and that has a wireless transceiver function, or a chip that canbe disposed on the terminal device. The terminal device may also bereferred to as user equipment (user equipment, UE), a user apparatus, anaccess terminal, a subscriber unit, a subscriber station, a mobilestation, a mobile console, a remote station, a remote terminal, a mobiledevice, a user terminal, a terminal, a wireless communications device, auser agent, or a user apparatus. The terminal device in the embodimentsof this application may be a mobile phone (mobile phone), a tablet(Pad), a computer having the wireless transceiver function, a virtualreality (virtual reality, VR) terminal device, an augmented reality(augmented reality, AR) terminal device, a wireless terminal inindustrial control (industrial control), a wireless terminal in selfdriving (self driving), a wireless terminal in telemedicine (remotemedical), a wireless terminal in a smart grid (smart grid), a wirelessterminal in transportation safety (transportation safety), a wirelessterminal in a smart city (smart city), a wireless terminal in a smarthome (smart home), or the like.

It should be understood that FIG. 1 is merely a simplified schematicdiagram used as an example for ease of understanding. The communicationssystem may further include another network device or another terminaldevice that is not shown in FIG. 1 .

With reference to the accompanying drawings, the following describes indetail a data transmission method, an apparatus, and a device in a Wi-Finetwork that are provided in the embodiments of this application.

FIG. 2 is a schematic flowchart of a data transmission method in a Wi-Finetwork according to an embodiment of this application. The method isapplicable to communication between the terminal and the network accessdevice in the communications system shown in FIG. 1 . As shown in FIG. 2, the data transmission method in the Wi-Fi network includes thefollowing steps.

S201: The network access device receives an uplink packet.

For example, the network access device may receive, through a wirelessconnection between the network access device and the terminal, forexample, a wireless connection in a Wi-Fi system or an uplink (uplink)in a cellular network, an uplink packet sent by the terminal. The uplinkpacket may carry uplink 5-tuple information. For example, the uplink5-tuple information may include an uplink source internet protocol(internet protocol, IP) address, an uplink destination IP address, anuplink source port, an uplink destination port, and an uplinktransmission protocol type. The uplink source IP address and the uplinksource port may be an IP address and a port number of the terminal, theuplink destination IP address and the uplink destination port may be anIP address and a port number of a server, and the uplink transmissionprotocol type may be a transmission protocol type used for the uplinkpacket, such as a user datagram protocol (user data gram protocol, UDP)or a transmission control protocol (transmission control protocol, TCP).

Optionally, the uplink packet may further carry a real-time transmissionindication that is set by a user. The real-time transmission indicationis used to indicate the network access device to preferably forwarddownlink packets of one or more service types that are set by the user.

Table 1 shows an example of a forwarding priority mapping relationshipspecified in an existing WMM protocol. As shown in Table 1, the secondcolumn to the fourth column are successively a differentiated servicescode point (differentiated services codepoint, DSCP), a user priority(user priority, UP) defined in 802.11e, and an access category AC. Forexample, referring to the access category AC, a video stream and anaudio stream are service types that need to be preferably forwarded. Aforwarding priority of the audio stream is higher than that of the videostream. Correspondingly, user priority values of the video stream andthe audio stream are 4-5 and 6-7 respectively, and DSCP values of thevideo stream and the audio stream are 32-47 and 48-63 respectively. Itis easy to understand that the network access device may parse one ormore of a DSCP value, a UP value, and an AC value carried in a packet,to provide differentiated data transmission services for different usersor service types.

For example, in the existing WMM protocol, a game service is consideredas the video stream, and a forwarding priority of the game service islower than that of the audio stream. Therefore, for a game user, whenthere are a relatively large quantity of downlink packets of a voicestream, or a downlink bandwidth usage of a video stream other than thegame service, such as video playback, is relatively high, because theforwarding priority of the game service is lower than that of the voicestream and is the same as that of another video stream, the networkaccess device may not preferably forward a game packet. Consequently, atransmission delay of the game packet is relatively long, problems suchas game freezing occur, and user experience is relatively poor.

In this embodiment of this application, a preset service type may bemanually set, for example, the real-time transmission indication of thegame service that the user is most interested in, that is, a relativelyhigh forwarding priority is set for the preset service type. Forexample, the user may set the real-time transmission indication in anuplink packet of the preset service type. Specifically, one or more ofthe following real-time transmission indications may be set in a DSCPfield or a ToS field of a header of the uplink packet: a differentiatedservices code point DSCP value corresponding to a highest forwardingpriority, a user priority UP value corresponding to the highestforwarding priority, the access category AC corresponding to the highestforwarding priority, a minimum transmission delay, or the like.

For example, the game user may set, on a game interface of the terminal,a forwarding priority of a downlink packet of the game service to ahighest priority, for example, higher than or equal to a forwardingpriority of the voice stream. Specifically, the game user may enter thereal-time transmission indication on an input interface provided by theterminal, for example, a graphical user interface or a command lineinput window of the game software. The real-time transmission indicationmay be a maximum forwarding delay with a relatively small value, forexample, 10 milliseconds (millisecond, ms), or 20 ms, or may be apriority value corresponding to the highest forwarding priority. This isnot limited in this embodiment of this application.

TABLE 1 Priority DSCP UP AC Definition In ascending 0-7 1 AC_BKBackground data order of  8-15 2 AC_BK Background data priorities from16-23 0 AC_BE Best effort top to bottom 24-31 3 AC_BE Best effort 32-394 AC_VI Video 40-47 5 AC_VI Video 48-55 6 AC_VO Audio 56-63 7 AC_VOAudio

In addition, the uplink packet may further carry information such as apacket length and a sending time of the uplink packet.

S202: The network access device records the real-time transmissionindication and the uplink 5-tuple information that are carried in theuplink packet.

For example, the network access device may record the real-timetransmission indication and the uplink 5-tuple information in localstorage space of an access network, for example, in a packet forwardingtable of the network access device or in a configuration file that maybe invoked by a control program of the access network. This is notlimited in this embodiment of this application.

In addition, the network access device may further obtain statisticsinformation of an uplink packet from a specified terminal. For example,the network access device may parse a sending time carried in the uplinkpacket, and calculate a transmission delay of the uplink packet from theterminal to the network access device with reference to a receiving timeat which the network access device receives the uplink packet. It iseasy to understand that the network access device may further collectstatistics about a packet length and a quantity of the uplink packetfrom the specified terminal within a specified time period, andcalculate a transmission bandwidth occupied by the specified terminal.

S203: The network access device receives a downlink packet. The downlinkpacket carries downlink 5-tuple information.

For example, the network access device may receive, through acommunications connection to an external network such as a server in theexternal network, for example, a communications cable includes anoptical fiber, a network cable, or the like, and/or a network route ofan intermediate node, a downlink packet sent by the external network.The downlink 5-tuple information may include a downlink source internetprotocol IP address, a downlink destination IP address, a downlinksource port, a downlink destination port, and a downlink transmissionprotocol type. The downlink source IP address and the downlink sourceport may be a device in the external network, for example, an IP addressand a port number of the server. The downlink destination IP address andthe downlink destination port may be an IP address and a port number ofthe terminal. The downlink transmission protocol type may be a networktransmission protocol type used for the downlink packet, such as a UDPprotocol or a TCP protocol.

It should be noted that the uplink packet and the downlink packet mayuse a same transmission protocol type, or may use different transmissionprotocol types. This is not limited in this embodiment of thisapplication.

In addition, the network access device may further obtain statisticsinformation of downlink packets from the external network, for example,a specified server. For example, the network access device may parse asending time carried in the downlink packet, and calculate atransmission delay of the information packet from the external networkto the network access device with reference to a receiving time at whichthe network access device receives the information packet. It is easy tounderstand that the network access device may further collect statisticsabout a packet length and a quantity of the downlink packet from thespecified server within a specified time period, and calculate atransmission bandwidth occupied by the downlink packet.

S204: The network access device determines that a service type of thedownlink packet is the preset service type, and that the downlink5-tuple information matches the uplink 5-tuple information.

In this embodiment of this application, the preset service type may bemanually set by the user. For example, the game user sets, by using asetting button in a graphical user interface of an online game installedin the terminal, the online game to the preset service type. For anotherexample, a network novel user may set, by using a setting button in agraphical user interface of a network novel application programinstalled in the terminal, the network novel to the preset service type.

Specifically, the preset service type may be set based on at least oneof the following parameters: an IP address of a network device thatprovides a service of the preset service type, a port number, a usedtransmission protocol type, an occupied uplink/downlink bandwidth, apacket length, an arrival time deviation, and the like. Correspondingly,the network access device may receive the foregoing parameter that is ofthe preset service type and that is set by the terminal, and determine,based on the foregoing parameter, statistical information of the networkaccess device, a bandwidth occupied by the downlink packet, atransmission delay, QoS information, and the like, whether the servicetype of the received downlink packet is the preset service type.

For example, using a game as an example, the determining that a servicetype of the downlink packet is the preset service type may include thefollowing step:

It is determined that the service type of the downlink packet is thepreset service type if the downlink packet meets at least one of thefollowing conditions:

The downlink source IP address is a source IP address that provides areal-time transmission service, for example, an IP address of a gameserver.

The downlink source port is a source port that provides the real-timetransmission service, for example, a sending port number of the gameserver.

The downlink transmission protocol type is a transmission protocol typeused for the real-time transmission service, for example, a transmissionprotocol type used for the game packet may be the UDP protocol or theTCP protocol.

The bandwidth occupied by the downlink packet is less than a downlinkbandwidth threshold. The downlink bandwidth threshold is a relativelysmall value, for example, less than 0.5 Mbps (mega bits per second,Mbps) or 1 Mbps.

The packet length of the downlink packet is less than a downlink packetlength threshold, for example, 100 bytes (bytes, B).

The deviation between arrival times of any two adjacent downlink packetsis less than a downlink time deviation threshold, for example, 50 ms or100 ms, that is, an arrival time interval of the downlink packets isrelatively stable.

It is easy to understand that for downlink packets of different presetservice types, such as video playback, the foregoing determiningconditions may be different. For example, that the bandwidth occupied bythe downlink packet is less than a downlink bandwidth threshold may bereplaced with the following: the bandwidth occupied by the downlinkpacket is greater than or equal to another downlink bandwidth threshold.The another downlink bandwidth threshold is usually a relatively largevalue, for example, 1 Mbps. For another example, the packet length ofthe downlink packet is greater than or equal to a downlink packet lengththreshold. The downlink packet length threshold may be 200 bytes, 500bytes, or the like.

Because a transmission direction of the downlink packet is opposite to atransmission direction of the uplink packet, a service type is presetbetween a same terminal and a same network device such as a game serverin the external network. The source IP address, the source port, thedestination IP address, and the destination port of the downlink packetare respectively corresponding to the destination IP address, thedestination port, the source IP address, and the source port of theuplink packet that are recorded in S202. Therefore, optionally, that thedownlink 5-tuple information matches the uplink 5-tuple information mayinclude:

The downlink source IP address is the same as the uplink destination IPaddress.

The downlink destination IP address is the same as the uplink source IPaddress.

The downlink source port is the same as the uplink destination port.

The downlink destination port is the same as the uplink source port.

The downlink transmission protocol type is the same as the uplinktransmission protocol type.

S205: The network access device preferably forwards the downlink packetbased on the real-time transmission indication.

For example, if it is determined, in S204, that the downlink packet is apacket of the preset service type, and it is determined, in S204, thatthe downlink 5-tuple information matches the uplink 5-tuple informationrecorded in S202, it may be determined that the downlink packet is adownlink packet that is of the preset service type and that needs to bepreferably forwarded. The downlink packet is preferably forwarded to theterminal based on the real-time transmission indication recorded inS202.

Optionally, the network access device may add, based on the real-timetransmission indication that is carried in the uplink packet and that isrecorded in S202, the uplink 5-tuple information carried in the uplinkpacket or the downlink 5-tuple information that matches the uplink5-tuple information to a local routing and forwarding table of thenetwork access device. When determining that the received downlinkpacket is of the preset service type and/or that the downlink 5-tupleinformation carried in the received downlink packet matches the uplink5-tuple information or the downlink 5-tuple information in the routingand forwarding table, the network access device immediately forwards thedownlink packet.

Optionally, the network access device may not modify the routing andforwarding table, but writes the foregoing operation related topreferable forwarding into the control program of the access device inan embedded manner, or write the operation related to preferableforwarding into the configuration file that can be invoked by thecontrol program of the network access device. This is not limited inthis embodiment of this application.

It is easy to understand that, when a data volume of the downlink packetthat needs to be forwarded by the network access device is relativelysmall, or the bandwidth occupied by the downlink packet is relativelysmall, forwarding of the downlink packet of the preset service type isnot adversely affected. For example, the transmission delay may still bewithin an acceptable range, and user experience is not affected.Therefore, to reduce control complexity of the network access device, ina possible design method, before S204 in which the network access devicedetermines that a service type of the downlink packet is the presetservice type is performed, the data transmission method in the Wi-Finetwork shown in FIG. 2 may further include one or more of thefollowing:

determining that a downlink data volume is greater than a downlink datavolume threshold; and

determining that the downlink bandwidth is greater than the downlinkbandwidth threshold.

In addition, to further reduce the control complexity of the accessdevice, an exit mechanism may also be set for the data transmissionmethod in the Wi-Fi network shown in FIG. 2 . Therefore, in a possibledesign method, the data transmission method in the Wi-Fi network shownin FIG. 2 may further include the following step:

not preferably forwarding a downlink packet that corresponds to theuplink 5-tuple information and/or the downlink 5-tuple information andthat does not appear within a specified time period, where the specifiedtime period may be set by the terminal, or may be set by the networkaccess device by default, for example, may be set to 30 minutes, or 1hour.

It is easy to understand that, when existing resources of the networkaccess device cannot ensure forwarding requirements of all downlinkpackets, forwarding of some downlink packets may be further limited, soas to ensure forwarding requirements of the other downlink packets.Therefore, in another possible design method, the data transmissionmethod in the Wi-Fi network shown in FIG. 2 may further include thefollowing step:

limiting a downlink packet bandwidth of a first specified station STA.

For example, the limiting a downlink packet bandwidth of a firstspecified station STA may include at least one of the following:

limiting an amount of uplink 5-tuple information and/or downlink 5-tupleinformation corresponding to a downlink packet preferably forwarded tothe first specified station STA;

limiting a quantity of downlink packets preferably forwarded to thefirst specified station STA;

limiting a continuous transmission time occupied by a downlink packetpreferably forwarded to the first specified station STA; or

limiting the downlink packet bandwidth of the first specified stationSTA when preferably forwarding a downlink packet for a second specifiedstation STA.

According to the data transmission method in the Wi-Fi network providedin this application, the network access device records the real-timetransmission indication and the uplink 5-tuple information that arecarried in the uplink packet. When the service type of the downlinkpacket is the preset service type, the network access device maypreferably forward, based on the real-time transmission indication ofthe uplink packet, the downlink packet whose downlink 5-tupleinformation matches the uplink 5-tuple information. When a highforwarding priority that is set by an external network device such as aserver for the downlink packet of the preset service type is ignored,tampered with, or randomly used, the downlink packet that matches theuplink 5-tuple can still be preferably forwarded based on the real-timetransmission indication of the uplink packet. Therefore, an objective ofpreferably forwarding the downlink packet of the preset service type isachieved, and reliability of providing a differentiated datatransmission services by the network access device can be improved.

FIG. 3 is another schematic flowchart of a data transmission method in aWi-Fi network according to an embodiment of this application. The methodis applicable to communication between the terminal and the networkaccess device in the communications system shown in FIG. 1 . As shown inFIG. 3 , the data transmission method in the Wi-Fi network includes thefollowing steps.

S301: The network access device receives an uplink packet. The uplinkpacket carries a real-time transmission indication and uplink 5-tupleinformation.

S302: The network access device records the real-time transmissionindication and the uplink 5-tuple information that are carried in theuplink packet.

S303: The network access device receives a downlink packet. The downlinkpacket carries downlink 5-tuple information.

For specific implementations of S301 to S303, respectively refer to S201to S203. Details are not described herein again.

S304: The network access device determines that a service type of theuplink packet is a preset service type, and that the downlink 5-tupleinformation matches the uplink 5-tuple information.

For a manner of setting the preset service type, refer to S204. Detailsare not described herein again.

For example, using a game as an example, the determining that a servicetype of the uplink packet is the preset service type may include thefollowing step:

It is determined that the service type of the uplink packet is thepreset service type if the uplink packet meets at least one of thefollowing conditions:

The uplink destination IP address is a destination IP address thatprovides a real-time transmission service, for example, an IP address ofa game server.

The uplink destination port is a destination port that provides thereal-time transmission service, for example, a sending port number ofthe game server.

The uplink transmission protocol type is a transmission protocol typeused for the real-time transmission service, for example, a transmissionprotocol type used for the game packet may be a UDP protocol or a TCPprotocol.

A bandwidth occupied by the uplink packet is less than an uplinkbandwidth threshold. The uplink bandwidth threshold is a relativelysmall value, for example, less than 0.5 Mbps or 1 Mbps.

A packet length of the uplink packet is less than an uplink packetlength threshold, for example, 100 bytes.

It is easy to understand that, for uplink packets of different presetservice types, the foregoing determining conditions may be different.Specifically, the determining conditions may be set based on servicefeatures of the uplink packets of the different preset service types.Details are not described herein again.

It should be noted that S304 may be understood as including two steps:step A of “determining that a service type of the uplink packet is thepreset service type”, and step B of “determining that the downlink5-tuple information matches the uplink 5-tuple information”. Step A of“determining that a service type of the uplink packet is the presetservice type” in S304 may occur at any time point after S301 or beforeS305, and step A and other steps may be performed in a plurality ofsequences. In a possible implementation, step A may be performedimmediately after the uplink packet is received in S301, that is, may beperformed before S302, or may be performed in a process of performingS302. In this way, “the real-time transmission indication and the uplink5-tuple information that are carried in the uplink packet and that arerecorded” in S302 may be the real-time transmission indication and theuplink 5-tuple information that are carried in the uplink packet thathas been determined to be of the preset service type. In this case, aquantity of real-time transmission indications and an amount of uplink5-tuple information that are carried in the uplink packet and that arerecorded in S302 are usually relatively small, so that storage space ofthe network access device can be saved.

For an implementation of determining that the downlink 5-tupleinformation matches the uplink 5-tuple information, refer to relateddescriptions in S204. Details are not described herein again.

S305: The network access device preferably forwards the downlink packetbased on the real-time transmission indication.

For a specific implementation of S305, refer to S205. Details are notdescribed herein again.

It is easy to understand that, when a data volume of the downlink packetthat needs to be forwarded by the network access device is relativelysmall, or a bandwidth occupied by the downlink packet is relativelysmall, forwarding of the downlink packet of the preset service type isnot adversely affected. For example, a transmission delay may still bewithin an acceptable range, and user experience is not affected.Therefore, to reduce control complexity of the network access device, ina possible design method, before preferably forwarding the downlinkpacket based on the real-time transmission indication, the datatransmission method in the Wi-Fi network shown in FIG. 3 may furtherinclude one or more of the following:

determining that a downlink data volume is greater than a downlink datavolume threshold; and

determining that the downlink bandwidth is greater than a downlinkbandwidth threshold.

In addition, to further reduce the control complexity of the accessdevice, an exit mechanism may also be set for the data transmissionmethod in the Wi-Fi network shown in FIG. 3 . Therefore, in a possibledesign method, the data transmission method in the Wi-Fi network shownin FIG. 3 may further include the following step:

not preferably forwarding a downlink packet that corresponds to theuplink 5-tuple information and/or the downlink 5-tuple information andthat does not appear within a specified time period. The specified timeperiod may be set by the terminal, or may be set by the network accessdevice by default, for example, may be set to 30 minutes, or 1 hour.

It is easy to understand that, when existing resources of the networkaccess device cannot ensure forwarding requirements of all downlinkpackets, forwarding of some downlink packets may be further limited, soas to ensure forwarding requirements of the other downlink packets.Therefore, in another possible design method, the data transmissionmethod in the Wi-Fi network shown in FIG. 3 may further include:

limiting a downlink packet bandwidth of a first specified station STA.

Optionally, the limiting a downlink packet bandwidth of a firstspecified station STA may include at least one of the following:

limiting an amount of uplink 5-tuple information and/or downlink 5-tupleinformation corresponding to a downlink packet preferably forwarded tothe first specified station STA;

limiting a quantity of downlink packets preferably forwarded to thefirst specified station STA;

limiting a continuous transmission time occupied by a downlink packetpreferably forwarded to the first specified station STA; or

limiting the downlink packet bandwidth of the first specified stationSTA when preferably forwarding a downlink packet to a second specifiedstation STA.

According to the data transmission method in the Wi-Fi network providedin this application, the network access device determines that theservice type of the uplink packet is the preset service type, andrecords the real-time transmission indication and the uplink 5-tupleinformation that are carried in the uplink packet. Then, the networkaccess device may preferably forward, based on the real-timetransmission indication of the uplink packet, the downlink packet whosedownlink 5-tuple information matches the uplink 5-tuple information.When a high priority that is set by an external network device such as aserver for the downlink packet is ignored, tampered with, or randomlyused, the downlink packet that matches the uplink 5-tuple can still bepreferably forwarded based on the real-time transmission indication ofthe uplink packet. Therefore, an objective of preferably forwarding thedownlink packet of the preset service type is achieved, and reliabilityof providing a differentiated data transmission services by the networkaccess device can be improved.

It should be noted that the data transmission method in the Wi-Finetwork shown in FIG. 2 and the data transmission method in the Wi-Finetwork shown in FIG. 3 may also be used in combination. For example,the downlink packet may be preferably forwarded based on the real-timetransmission indication of the uplink packet only when both the servicetype of the uplink packet and the service type of the downlink packetare the preset service type and the uplink 5-tuple matches the downlink5-tuple, so as to further improve accuracy and efficiency of identifyingand forwarding a high-priority downlink packet.

In the foregoing data transmission methods in the Wi-Fi network shown inFIG. 2 and FIG. 3 , the following manner is used to preferably forwardthe downlink packet of the preset service type. To be specific, thedownlink packet carrying the downlink 5-tuple information that matchesthe uplink 5-tuple information carried in the uplink packet ispreferably forwarded based on the real-time transmission indicationcarried in the uplink packet. To further simplify design complexity ofthe network access device, the downlink packet of the preset servicetype may alternatively be preferably forwarded based only on a trafficcharacteristic of the downlink packet. The following provides a detaileddescription with reference to FIG. 4 .

FIG. 4 is still another schematic flowchart of a data transmissionmethod in a Wi-Fi network according to an embodiment of thisapplication. The method is applicable to communication between theterminal and the network access device in the communications systemshown in FIG. 1 . As shown in FIG. 4 , the data transmission method inthe Wi-Fi network includes the following steps:

S401: The network access device receives a downlink packet.

For a specific implementation, refer to S203. Details are not describedherein again.

S402: The network access device determines that a service type of thedownlink packet is a preset service type.

For a specific implementation, refer to S204. Details are not describedherein again.

S403: The network access device preferably forwards the downlink packet.

Specifically, if it is determined, in S402, that the downlink packet isa packet of the preset service type, the downlink packet may bepreferably forwarded to a terminal. For example, the foregoingoperations related to determining of the preset service type andpreferable forwarding may be written into a control program of theaccess device in an embedded manner, or written into a configurationfile that can be invoked by the control program of the network accessdevice. This is not limited in this embodiment of this application.

According to the data transmission method in the Wi-Fi network providedin this application, the network access device can identify andpreferably forward the downlink packet of the preset service type. Thiscan resolve a problem that when a high priority that is set by anexternal network device such as a server for a downlink packet isignored, tampered with, or randomly used, the network access devicecannot preferably forward the downlink packet of the preset servicetype, so that reliability of providing differentiated data transmissionservices by the network access device is improved.

The data transmission method in the Wi-Fi network provided in theembodiments of this application is described above in detail withreference to FIG. 2 to FIG. 4 . With reference to FIG. 5 and FIG. 6 ,the following describes in detail a communications apparatus in a Wi-Finetwork according to the embodiments of this application.

FIG. 5 is a schematic structural diagram of a communications apparatusin a Wi-Fi network according to an embodiment of this application. Thecommunications apparatus is applicable to the communications systemshown in FIG. 1 , and is configured to perform a function of the networkaccess device in the data transmission method in the Wi-Fi network shownin FIG. 2 or FIG. 3 . For ease of description, FIG. 5 shows only maincomponents of the communications apparatus.

As shown in FIG. 5 , a communications apparatus 500 in a Wi-Fi networkincludes: a processing module 501, a first transceiver module 502, and asecond transceiver module 503.

The first transceiver module 502 is configured to receive an uplinkpacket. The uplink packet carries a real-time transmission indicationand uplink 5-tuple information.

The second transceiver module 503 is configured to receive a downlinkpacket. The downlink packet carries downlink 5-tuple information.

The processing module 501 is further configured to: if a service type ofthe uplink packet or the downlink packet is a preset service type, andthe downlink 5-tuple information matches the uplink 5-tuple information,control the first transceiver module 502 to preferably forward thedownlink packet based on the real-time transmission indication.

For example, the real-time transmission indication may include one ormore of the following: a differentiated services code point DSCP valuecorresponding to a highest forwarding priority, a user priority UP valuecorresponding to the highest forwarding priority, and an access categoryAC corresponding to the highest forwarding priority.

In a possible design, the processing module 501 is further configuredto: after the first transceiver module 502 receives the uplink packet,determine whether the service type of the uplink packet is the presetservice type. The processing module 501 is further configured to: if theservice type of the uplink packet is the preset service type, and thedownlink 5-tuple information matches the uplink 5-tuple information,control the first transceiver module 502 to preferably forward thedownlink packet based on the real-time transmission indication.

In another possible design, the processing module 501 is furtherconfigured to: after the second transceiver module 503 receives thedownlink packet, determine whether the service type of the downlinkpacket is the preset service type. The processing module 501 is furtherconfigured to: if the service type of the downlink packet is the presetservice type, and the downlink 5-tuple information matches the uplink5-tuple information, control the first transceiver module 502 topreferably forward the downlink packet based on the real-timetransmission indication.

For example, the downlink 5-tuple information includes a downlink sourceinternet protocol IP address, a downlink destination IP address, adownlink source port, a downlink destination port, and a downlinktransmission protocol type. Correspondingly, that the service type ofthe downlink packet is the preset service type may include that thedownlink packet meets at least one of the following conditions:

The downlink source IP address is a source IP address that provides areal-time transmission service.

The downlink source port is a source port that provides the real-timetransmission service.

The downlink transmission protocol type is a transmission protocol typeused for the real-time transmission service.

A bandwidth occupied by the downlink packet is less than a downlinkbandwidth threshold.

A length of the downlink packet is less than a downlink packet lengththreshold. A deviation between arrival times of any two adjacentdownlink packets is less than a downlink time deviation threshold.

For example, the uplink 5-tuple information includes an uplink sourceinternet protocol IP address, an uplink destination IP address, anuplink source port, an uplink destination port, and an uplinktransmission protocol type. Correspondingly, that the downlink 5-tupleinformation matches the uplink 5-tuple information includes: Thedownlink source IP address is the same as the uplink destination IPaddress. The downlink destination IP address is the same as the uplinksource IP address. The downlink source port is the same as the uplinkdestination port. The downlink destination port is the same as theuplink source port. The downlink transmission protocol type is the sameas the uplink transmission protocol type.

In a possible design, the processing module 501 is further configuredto: before that the processing module 501 controls the first transceivermodule 502 to preferably forward the downlink packet based on thereal-time transmission indication, determine that a downlink data volumeis greater than a downlink data volume threshold, or determine that thedownlink bandwidth is greater than the downlink bandwidth threshold.

In a possible design method, the processing module 501 is furtherconfigured to determine not to preferably forward a downlink packet thatcorresponds to the uplink 5-tuple information and/or the downlink5-tuple information and that does not appear within a specified timeperiod.

In another possible design method, the processing module 501 is furtherconfigured to limit a downlink packet bandwidth of a first specifiedstation STA.

For example, the limiting a downlink packet bandwidth of a firstspecified station STA may include one or more of the following:

limiting an amount of uplink 5-tuple information and/or downlink 5-tupleinformation corresponding to a downlink packet preferably forwarded tothe first specified station STA; or

limiting a quantity of downlink packets preferably forwarded to thefirst specified station STA; or

limiting a continuous transmission time occupied by a downlink packetpreferably forwarded to the first specified station STA; or

limiting the downlink packet bandwidth of the first specified stationSTA when preferably forwarding a downlink packet to a second specifiedstation STA.

The communications apparatus 500 in the Wi-Fi network shown in FIG. 5 isalso applicable to the communications system shown in FIG. 1 , and isconfigured to perform a function of the network access device in thedata transmission method in the Wi-Fi network shown in FIG. 4 .

As shown in FIG. 5 , the second transceiver module 503 is configured toreceive the downlink packet.

The processing module 501 is configured to: if the service type of thedownlink packet is the preset service type, control the firsttransceiver module 502 to preferably forward the downlink packet.

For example, the downlink packet carries a downlink source internetprotocol IP address, a downlink destination IP address, a downlinksource port, a downlink destination port, and a downlink transmissionprotocol type. Correspondingly, the processing module 501 is furtherconfigured to: if the downlink packet meets at least one of thefollowing conditions, determine that the service type of the downlinkpacket is the preset service type:

The downlink source IP address is a source IP address that provides areal-time transmission service.

The downlink source port is a source port that provides the real-timetransmission service.

The downlink transmission protocol type is a transmission protocol typeused for the real-time transmission service.

The bandwidth occupied by the downlink packet is less than the downlinkbandwidth threshold.

A length of the downlink packet is less than a downlink packet lengththreshold. A deviation between arrival times of any two adjacentdownlink packets is less than a downlink time deviation threshold.

Optionally, the communications apparatus 500 in the Wi-Fi network shownin FIG. 5 may further include a storage module (not shown in FIG. 5 ).The storage module is configured to store an instruction. The processingmodule 501 is further configured to execute the instruction stored inthe storage module, so that the communications apparatus 500 in theWi-Fi network performs the data transmission method in the Wi-Fi networkshown in any one of FIG. 2 to FIG. 4 .

For example, the communications apparatus 500 in the Wi-Fi network maybe the network access device, or may be a chip or a chip system disposedin the network access device. This is not limited in this application.

It should be noted that both the first transceiver module 502 and thesecond transceiver module 503 may have a wireless local area network(local area network, LAN) interface or a wide area network (wide areanetwork, WAN) interface. An interface type of the first transceivermodule 502 and an interface type of the second transceiver module 503may be the same or different. In an implementation, the firsttransceiver module 502 has the LAN interface, and the second transceivermodule 503 has the WAN interface. In addition, the first transceivermodule 502 and the second transceiver module 503 may also simultaneouslysupport a plurality of interface types, for example, both the firsttransceiver module 502 and the second transceiver module 503simultaneously support the LAN interface and the WAN interface. The WANinterface is usually used to connect to a device (such as a network sidedevice) in an external network in a wired or wireless manner. The LANinterface is usually used to connect to a device (for example, a mobileterminal in a home network) in an internal network in a wired orwireless manner. When the wireless manner is used, the LAN interface maybe a WLAN interface (also referred to as a Wi-Fi interface).

FIG. 6 is a schematic structural diagram of a network access deviceaccording to an embodiment of this application. The network accessdevice is applicable to the communications system shown in FIG. 1 , andmay perform the data transmission method in the Wi-Fi network shown inany one of FIG. 2 to FIG. 4 . For ease of description, FIG. 6 shows onlymain components of the network access device.

As shown in FIG. 6 , a network access device 600 includes a processor601, a first transceiver 602, a second transceiver 603, and a memory604. The first transceiver 602 is configured to receive an uplinkpacket. The second transceiver 603 is configured to receive a downlinkpacket. The first transceiver 602 is further configured to forward thedownlink packet. The memory 604 is configured to store an instruction.The processor 601 is configured to execute the instruction stored in thememory 604, so that the network access device 600 performs a function ofthe network access device in the data transmission method in the Wi-Finetwork shown in any one of FIG. 2 to FIG. 4 .

It should be noted that the network access device 600 may be the networkaccess device in the foregoing method embodiments, for example, anaccess point in a Wi-Fi network or a base station in a cellular networksystem. This is not limited in this application.

The embodiments of this application provide a communications system. Thecommunications system includes one or more terminals and the foregoingnetwork access device.

The embodiments of this application provide a computer-readable storagemedium that stores a program or an instruction. When the program or theinstruction is run on a computer, the computer is enabled to perform thedata transmission method in the Wi-Fi network shown in any one of FIG. 2to FIG. 4 .

The embodiments of this application provide a computer program product,including computer program code. When the computer program code is runon a computer, the computer is enabled to perform the data transmissionmethod in the Wi-Fi network shown in any one of FIG. 2 to FIG. 4 .

It should be understood that, the processor in the embodiments of thisapplication may be a central processing unit (central processing unit,CPU). The processor may further be another general purpose processor, adigital signal processor (digital signal processor, DSP), an applicationspecific integrated circuit (application specific integrated circuit,ASIC), a field programmable gate array (field programmable gate array,FPGA), or another programmable logic device, a discrete gate or atransistor logic device, a discrete hardware component, or the like. Thegeneral purpose processor may be a microprocessor, or the processor maybe any conventional processor or the like.

It should be further understood that the memory in the embodiments ofthis application may be a volatile memory or a nonvolatile memory, ormay include a volatile memory and a nonvolatile memory. The non-volatilememory may be a read-only memory (read-only memory, ROM), a programmableread-only memory (programmable ROM, PROM), an erasable programmableread-only memory (erasable PROM, EPROM), an electrically erasableprogrammable read-only memory (electrically EPROM, EEPROM), or a flashmemory. The volatile memory may be a random access memory (random accessmemory, RAM) that is used as an external cache. By using examples butnot limitative descriptions, many forms of random access memories(random access memory, RAM) may be used, for example, a static randomaccess memory (static RAM, SRAM), a dynamic random access memory (DRAM),a synchronous dynamic random access memory (synchronous DRAM, SDRAM), adouble data rate synchronous dynamic random access memory (double datarate SDRAM, DDR SDRAM), an enhanced synchronous dynamic random accessmemory (enhanced SDRAM, ESDRAM), a synchlink dynamic random accessmemory (synchlink DRAM, SLDRAM), and a direct rambus random accessmemory (direct rambus RAM, DR RAM).

All or some of the foregoing embodiments may be implemented by usingsoftware, hardware (for example, a circuit), firmware, or anycombination thereof. When the software is used to implement theembodiments, all or some of the foregoing embodiments may be implementedin a form of a computer program product. The computer program productincludes one or more computer instructions or computer programs. Whenthe program instructions or the computer programs are loaded or executedon a computer, procedures or functions according to the embodiments ofthis application are all or partially generated. The computer may be ageneral-purpose computer, a dedicated computer, a computer network, orother programmable apparatuses. The computer instructions may be storedin a computer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, infrared, radio, ormicrowave) manner. The computer-readable storage medium may be anyusable medium accessible by the computer, or a data storage device, suchas a server or a data center, integrating one or more usable media. Theusable medium may be a magnetic medium (for example, a floppy disk, ahard disk, or a magnetic tape), an optical medium (for example, a DVD),or a semiconductor medium. The semiconductor medium may be a solid-statedrive.

In this application, the term “and/or” describes an associationrelationship between associated objects and may indicate threerelationships. For example, A and/or B may indicate the following cases:Only A exists, both A and B exist, and only B exists, where A and B maybe singular or plural. The character “/” usually indicates an “or”relationship between the associated objects.

In this application, “at least one” refers to one or more, and “aplurality of” refers to two or more. “At least one of the followingitems (pieces)” or a similar expression thereof refers to anycombination of the items, and includes any combination of one item(piece) or a plurality of items (pieces). For example, “at least one ofa, b, or c” or “at least one of a, b, and c” may indicate: a, b, c, a-b(that is, a and b), a-c, b-c, or a-b-c, where a, b, and c may besingular or plural.

It should be understood that, in the embodiments of this application,sequence numbers of the foregoing processes do not mean executionsequences. Some or all steps may be executed in parallel or in sequence.The execution sequences of the processes should be determined based onfunctions and internal logic of the processes, and should not beconstrued as any limitation on the implementation processes of theembodiments of this application.

A person of ordinary skill in the art may be aware that units andalgorithm steps in the examples described with reference to theembodiments disclosed in this specification can be implemented byelectronic hardware or a combination of computer software and electronichardware. Whether the functions are performed by the hardware or thesoftware depends on particular applications and design constraintconditions of the technical solutions. A person skilled in the art mayuse different methods to implement the described functions for eachparticular application, but it should not be considered that such animplementation goes beyond the scope of this application.

A person skilled in the art may clearly understand that, for the purposeof convenient and brief description, for detailed working processes ofthe foregoing system, apparatus, and unit, refer to correspondingprocesses in the foregoing method embodiments. Details are not describedherein again.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiment is merely an example. For example, the unit division ismerely logical function division, and there may be another divisionmanner in actual implementation. For example, a plurality of units orcomponents may be combined or integrated into another system, or somefeatures may be ignored or not performed. In addition, the displayed ordiscussed mutual couplings or direct couplings or communicationconnections may be implemented through some interfaces. The indirectcouplings or communication connections between the apparatuses or unitsmay be implemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected based on actualrequirements to achieve the objectives of the solutions of theembodiments.

In addition, function units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit.

When the functions are implemented in a form of a software function unitand sold or used as an independent product, the functions may be storedin a computer-readable storage medium. Based on such an understanding,the technical solutions of this application essentially, or the partcontributing to the prior art, or some of the technical solutions may beimplemented in a form of a software product. The computer softwareproduct is stored in a storage medium, and includes several instructionsfor instructing a computer device (which may be a personal computer, aserver, a network device or a terminal device) to perform all or some ofthe steps of the methods described in the embodiments of thisapplication. The foregoing storage medium includes any medium that canstore program code, for example, a USB flash drive, a removable harddisk, a ROM, a RAM, a magnetic disk, or an optical disc.

Related parts of the method embodiments of this application may bemutually referenced. The apparatus provided in each apparatus embodimentis configured to perform the method provided in the corresponding methodembodiment. Therefore, each apparatus embodiment may be understood withreference to a related part in a related method embodiment.

Structural diagrams of the apparatuses provided in the apparatusembodiments of this application merely show simplified designs of thecorresponding apparatuses. In actual application, the apparatus mayinclude any quantities of transmitters, receivers, processors, memories,and the like, to implement functions or operations performed by theapparatuses in the apparatus embodiments of this application, and allapparatuses that can implement this application fall within theprotection scope of this application.

Names of messages/frames/indication information, modules, units, or thelike provided in the embodiments of this application are merelyexamples, and other names may be used provided that themessages/frames/indication information, modules, units, or the like havesame functions.

The terms used in the embodiments of this application are merely for thepurpose of illustrating specific embodiments, and are not intended tolimit the present invention. The terms “a”, “an” and “the” of singularforms used in the embodiments of this application and the appendedclaims are also intended to include plural forms, unless otherwisespecified in the context clearly. It should also be understood that, theterm “and/or” used in this specification indicates and includes any orall possible combinations of one or more associated listed items. Thecharacter “/” in this specification usually indicates an “or”relationship between the associated objects.

Depending on the context, for example, words “if” used herein may beexplained as “while” or “when” or “in response to determining” or “inresponse to detecting”. Similarly, depending on the context, phrases “ifdetermining” or “if detecting (a stated condition or event)” may beexplained as “when determining” or “in response to determining” or “whendetecting (the stated condition or event)” or “in response to detecting(the stated condition or event)”.

A person of ordinary skill in the art may understand that all or some ofthe steps of the method in the foregoing embodiments may be implementedby a program instructing related hardware. The program may be stored ina readable storage medium of a device, such as a FLASH or an EEPROM.When the program is executed, the program performs all or some of thesteps described above.

The foregoing descriptions are merely specific implementations of thisapplication, but are not intended to limit the protection scope of thisapplication. Any variation or replacement readily figured out by aperson skilled in the art within the technical scope disclosed in thisapplication shall fall within the protection scope of this application.Therefore, the protection scope of this application shall be subject tothe protection scope of the claims.

What is claimed is:
 1. A data transmission method implemented by anetwork access device in a wireless local area network, wherein the datatransmission method comprises: receiving a first uplink packet thatcarries uplink 5-tuple information, wherein the uplink 5-tupleinformation comprises an uplink source Internet Protocol (IP) address,an uplink destination IP address, an uplink source port, an uplinkdestination port, and an uplink transmission protocol type; receiving afirst downlink packet that carries downlink 5-tuple information, whereinthe downlink 5-tuple information comprises a downlink source IP address,a downlink destination IP address, a downlink source port, a downlinkdestination port, and a downlink transmission protocol type; determiningwhether a service type of the first uplink packet is a preset servicetype; prioritize forwarding the first downlink packet based on areal-time transmission indication when the service type of the firstuplink packet is the preset service type and when the downlink 5-tupleinformation matches the uplink 5-tuple information; and not preferablyforwarding a second downlink packet that corresponds to the downlink5-tuple information and is not received within a specified time period,wherein the service type is the preset service type when the uplinkdestination IP address provides a real-time transmission service, theuplink destination port provides the real-time transmission service, theuplink transmission protocol type is used for the real-time transmissionservice, a bandwidth of the first uplink packet is less than an uplinkbandwidth threshold, or a packet length of the first uplink packet isless than an uplink packet length threshold.
 2. The data transmissionmethod of claim 1, wherein the real-time transmission indicationcomprises one or more of a differentiated services code point (DSCP)value corresponding to a highest forwarding priority, a user priority(UP) value corresponding to the highest forwarding priority, or anaccess category (AC) corresponding to the highest forwarding priority.3. The data transmission method of claim 1, further comprising: addingthe uplink 5-tuple information from the first uplink packet to a localrouting and forwarding table of the network access device.
 4. The datatransmission method of claim 1, further comprising limiting a downlinkpacket bandwidth of a first specified station (STA).
 5. The datatransmission method of claim 4, further comprising one or more of:forwarding a plurality of downlink packets to the first specified STAand limiting a quantity of the downlink packets; or forwarding thesecond downlink packet to the first specified STA and limiting acontinuous transmission time of the second downlink packet.
 6. The datatransmission method of claim 4, further comprising limiting the downlinkpacket bandwidth when forwarding a third downlink packet to a secondspecified STA.
 7. The data transmission method of claim 1, whereindetermining whether the service type of the first uplink packet is thepreset service type occurs before receiving the first downlink packet.8. The data transmission method of claim 1, wherein determining whetherthe service type of the first uplink packet is the preset service typeoccurs after receiving the first downlink packet.
 9. A communicationsapparatus, comprising: a first transceiver; a second transceiver; aprocessor coupled to the first transceiver and the second transceiverand configured to: receive a first uplink packet that carries uplink5-tuple information, wherein the uplink 5-tuple information comprises anuplink source Internet Protocol (IP) address, an uplink destination IPaddress, an uplink source port, an uplink destination port, and anuplink transmission protocol type; receive a first downlink packet,wherein the first downlink packet carries downlink 5-tuple information,and wherein the downlink 5-tuple information comprises a downlink sourceIP address, a downlink destination IP address, a downlink source port, adownlink destination port, and a downlink transmission protocol type;determine whether a service type of the first uplink packet is a presetservice type; preferably forward the first downlink packet based on areal-time transmission indication when the service type of the firstuplink packet is the preset service type and when the downlink 5-tupleinformation matches the uplink 5-tuple information; and not preferablyforward a second downlink packet that corresponds to the downlink5-tuple information and is not received within a specified time period,wherein the service type is the preset service type when the firstuplink packet meets at least one of the following conditions: the uplinkdestination IP address provides a real-time transmission service, theuplink destination port provides the real-time transmission service, theuplink transmission protocol type is used for the real-time transmissionservice, a bandwidth of the first uplink packet is less than an uplinkbandwidth threshold, or a packet length of the first uplink packet isless than an uplink packet length threshold.
 10. The communicationsapparatus of claim 9, wherein the real-time transmission indicationcomprises one or more of a differentiated services code point (DSCP)value corresponding to a highest forwarding priority, a user priority(UP) value corresponding to the highest forwarding priority, or anaccess category (AC) corresponding to the highest forwarding priority.11. The communications apparatus of claim 9, wherein the processor isconfigured to add uplink 5-tuple information from an uplink packet to alocal routing and forwarding table of the communications apparatus. 12.The communications apparatus of claim 9, wherein the communicationsapparatus is further configured to limit a downlink packet bandwidth ofa first specified station (STA).
 13. The communications apparatus ofclaim 12, wherein the communications apparatus is further configured to:forward a plurality of downlink packets to the first specified STA andlimit a quantity of the downlink packets; or forward the second downlinkpacket to the first specified STA and limit a continuous transmissiontime of the second downlink packet.
 14. The communications apparatus ofclaim 12, wherein the communications apparatus is further configured tolimit the downlink packet bandwidth when forwarding a third downlinkpacket to a second specified STA.
 15. The communications apparatus ofclaim 9, wherein the communications apparatus is further configured todetermine whether the service type of the first uplink packet is thepreset service type before receiving the first downlink packet.
 16. Thecommunications apparatus of claim 9, wherein the communicationsapparatus is further configured to determine whether the service type ofthe first uplink packet is the preset service type after receiving thefirst downlink packet.
 17. A computer program product comprisingcomputer-executable instructions stored on a non-transitorycomputer-readable medium that, when executed by a processor, cause acommunications apparatus to: receive an uplink packet that carriesuplink 5-tuple information, wherein the uplink 5-tuple informationcomprises an uplink source Internet Protocol (IP) address, an uplinkdestination IP address, an uplink source port, an uplink destinationport, and an uplink transmission protocol type; receive a downlinkpacket, wherein the downlink packet carries downlink 5-tupleinformation, and wherein the downlink 5-tuple information comprises adownlink source IP address, a downlink destination IP address, adownlink source port, a downlink destination port, and a downlinktransmission protocol type; determine whether a service type of theuplink packet is a preset service type; preferably forward the downlinkpacket based on a real-time transmission indication when the servicetype of the uplink packet is the preset service type and when thedownlink 5-tuple information matches the uplink 5-tuple information; andnot preferably forward a second downlink packet that corresponds to thedownlink 5-tuple information and is not received within a specified timeperiod, wherein the service type is the preset service type when theuplink destination IP address is configured to provide a real-timetransmission service, the uplink destination port provides the real-timetransmission service, the uplink transmission protocol type is used forthe real-time transmission service, a bandwidth of the uplink packet isless than an uplink bandwidth threshold, or a packet length of theuplink packet is less than an uplink packet length threshold.
 18. Thecomputer program product of claim 17, wherein the instructions furthercause the processor to add uplink 5-tuple information from the uplinkpacket to a local routing and forwarding table of the communicationsapparatus.
 19. The computer program product of claim 17, wherein theinstructions further cause the processor to determine whether theservice type of the uplink packet is the preset service type beforereceiving the downlink packet.
 20. The computer program product of claim17, wherein the instructions further cause the processor to determinewhether the service type of the uplink packet is the preset service typeafter receiving the downlink packet.